﻿@namespace CyssBlazor.Shared.Components
@inherits BaseValidateComponent<string>
@using BootstrapBlazor.Components

<DateTimePicker @bind-Value=DateTimeValue DisplayText=@this.DisplayText ShowLabel=@this.ShowLabel></DateTimePicker>

@code
{
    public DateTime? DateTimeValue
    {
        set
        {
            this.Value = value.HasValue ? value.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
        }
        get
        {
            if (string.IsNullOrWhiteSpace(this.Value))
            {
                return null;
            }
            return DateTime.Parse(this.Value);
        }
    }

}